// 具体查看官方文档
import {
    createRouter, // 创建路由
    createWebHistory, // history模式
  } from "vue-router";
  
  const routes = [
    {
      path: "/",
      children: [
        {
          path: "",
          redirect: "/index",
        },
        {
          name: "Home",
          path: "/index",
          // vite下，组件路径必须完整，带上vue后缀
          component: () => import("@/views/home.vue"),
        },
        {
            name:"Show",
            path:"/show",
            component:()=>import("@/views/show.vue")
        }
      ],
    },
  ];
  
  const router = createRouter({
    history: createWebHistory(),
    routes,
  });
  
  export default router;